Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Displaying Rendered • View rawDownload


docs/agents/conventions/tests.md e5756d7ab065475a18acdcafc008a767fcff87e0 (e5756d7a) Text, 2.08 KB

Test conventions

Applies when editing T383838tests/**/*.{py,js}.

• Backend: T383838tests/backend/test_*.py with pytest + asyncio auto mode.
• Frontend: T383838tests/frontend/*.test.js with vitest + T383838@vue/test-utils.
• Mock T383838window.api for page tests. Assert toasts when outcomes are user-visible.
• Prefer focused files over full suite unless the user asks for broad runs.
• Landlock tests that apply the sandbox must run in a subprocess (one restrict per process).
• Long-running / notification soak suites can hang. Prefer timeouts and avoid piping pytest through T383838tail in agent shells.

Oracle style (no soft fuzz)

Property and fuzz tests must assert an accept or reject outcome, not only that nothing crashed.

Refuse these patterns:

• Bare T383838except Exception: pass around the code under test
• T383838never_raises tests with no postcondition
• Asserting only that a result dict has an T383838"ok" key without checking True or False
• Mocks that return the success path for every input under a security oracle

Prefer:

• Independent oracle: given input X, predict accept or reject, then assert the code matches
• Jail oracles: on success, resolved path stays under the allowed root
• Closed reason sets: on T383838ValueError, the message is one of the known machine reasons
• Round-trip or shape invariants when the API is pure parsing

Full skill: T383838docs/agents/skills/test-oracles/SKILL.md.
Path jail filesystem features: T383838docs/agents/skills/path-jail-local-fs/SKILL.md and T383838docs/agents/conventions/path-jail.md.
Exploratory bug hunting: T383838docs/agents/skills/exploratory-testing/SKILL.md.

Extended Edge Case Tester (EECT) and Live Validation (LV)

• EECT packs live under T383838tests/backend/eect/packs/ and use marker T383838eect.
• LV ladder lives under T383838tests/backend/eect/live/ and uses marker T383838live_validation.
• Replay a failure with T383838MESHCHAT_EECT_SEED=<seed> (printed on assert failure).
• Commands: T383838task test:eect, T383838task test:lv:l0, T383838MESHCHAT_LIVE_VALIDATION=1 task test:lv.
• LV L2/L3 are opt-in (T383838MESHCHAT_LIVE_VALIDATION=1 or T383838MESHCHAT_LIVE_RETICULUM=1). L0/L1 stay CI-safe.


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────